package com.jy.wms.web;

import com.jy.wms.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by yjs on 2018/7/27.
 */
@Controller
@RequestMapping("/zjgz")
public class WmsZjgzRouter {
    /**
     * 质检规则页面跳转
     * @return
     */
    /*@RequestMapping(value = "zjgzList")
    public String zjgzList(){
        return  "zjgz/zjgzList";
    }*/

    @Autowired
    SysMenuService menuService;

    //主页面
    @RequestMapping(value = "/zjgzList/{menu}")
    public String goods(@PathVariable("menu") String menu, Model model) {
        model.addAttribute("functions",menuService.getFunctions(menu));
        return "zjgz/zjgzList";
    }

    /**
     * 跳转质检规则添加页面
     * @return
     */
    @RequestMapping(value = "addZjgz")
    public String addZjgz(){
        return  "zjgz/addZjgz";
    }

    /**
     * 跳添加比例明细页面
     * @return
     */
    @RequestMapping(value = "toAddZjgzMxbl")
    public String toAddZjgzMxbl(){
        return  "zjgz/addZjgzMxbl";
    }

    /**
     * 跳添加固定明细页面
     * @return
     */
    @RequestMapping(value = "toAddZjgzMxgd")
    public String toAddZjgzMxgd(){
        return  "zjgz/addZjgzMxgd";
    }
    /**
     * 跳转编辑生成页面
     * @param model
     * @param id
     * @return
     */
    @RequestMapping(value = "toEditZjgz")
    public String toEditZjgz(String id, Model model){
        model.addAttribute("id",id);
        return  "zjgz/editZjgz";
    }

    /**
     * 跳转查看明细页面
     * @param id
     * @param model
     * @return
     */
    @RequestMapping(value = "search_mx")
    public String toChakanKw(String id,String fs,Model model){
        model.addAttribute("id",id);
        model.addAttribute("fs",fs);
        return  "zjgz/zjgzChakanMx";
    }

    /**
     * 跳转库位组详情页面
     * @param id
     * @param model
     * @return
     */
    @RequestMapping(value = "/getFindKwz")
    public String getFindKwz(String id,Model model) {
        model.addAttribute("id",id);
        return "wmsLibrarypositiongroup/positiongroupXiangxi";
    }
}
